﻿Imports System.Text
Imports Microsoft.VisualStudio.TestTools.UnitTesting

Imports CQRSAzure.EventSourcing
Imports CQRSAzure.EventSourcing.Azure.Table

<TestClass()>
Public Class AzureTableEventStreamUnitTest

    <TestMethod()>
    Public Sub Reader_Constructor_TestMethod()

    End Sub

    ''' <summary>
    ''' Too short a name, append DATA to it
    ''' </summary>
    <TestMethod>
    Public Sub MakeValidStorageFolderName_TooShort_TestMethod()

        Dim expected As String = "aDATA"
        Dim actual As String = ""

        actual = TableEventStreamBase.MakeValidStorageTableName("-a")

        Assert.AreEqual(expected, actual)

    End Sub

    ''' <summary>
    ''' Too short a name, append DATA to it
    ''' </summary>
    <TestMethod>
    Public Sub MakeValidStorageTableName_TooShortAfterInvalid_TestMethod()

        Dim expected As String = "aDATA"
        Dim actual As String = ""

        actual = TableEventStreamBase.MakeValidStorageTableName("-... -!a")

        Assert.AreEqual(expected, actual)

    End Sub

    <TestMethod>
    Public Sub MakeValidStorageTableName_FixChars_TestMethod()

        Dim expected As String = "DuncansModel"
        Dim actual As String = ""

        actual = TableEventStreamBase.MakeValidStorageTableName("Duncan's Model")

        Assert.AreEqual(expected, actual)

    End Sub
End Class